commit: Don't delete tmp/cache dir
authorColin Walters <walters@verbum.org>
Mon, 29 Aug 2016 15:03:35 +0000 (11:03 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 29 Aug 2016 17:30:15 +0000 (17:30 +0000)
We hold a fd open on this, and it's basically now expected
to be immortal.  Confer that status.

This was showing up in flatpak crashers, because we'd get
an unexpected errno.

(I didn't test this fixes the crasher, but it's clearly right)

https://bugzilla.redhat.com/show_bug.cgi?id=1347293

Closes: #476
Approved by: alexlarsson

src/libostree/ostree-repo-commit.c

index 9a938ddc4f76e0250511b0341e0fd82a2a742253..8dfe276f0421e8076cccd13b51fdc01f837e94a2 100644 (file)
@@ -1219,6 +1219,12 @@ cleanup_tmpdir (OstreeRepo        *self,
       if (dent == NULL)
         break;
 
+      /* Special case this; we create it when opening, and don't want
+       * to blow it away.
+       */
+      if (strcmp (dent->d_name, "cache") == 0)
+        continue;
+
       if (TEMP_FAILURE_RETRY (fstatat (dfd_iter.fd, dent->d_name, &stbuf, AT_SYMLINK_NOFOLLOW)) < 0)
         {
           if (errno == ENOENT) /* Did another cleanup win? */